package cj.web.marriage.dao;
/*
 *  
 *  
*/
import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.marriage.domain.Follow;

/**
 * 
 * @author 
 *
 */
@DAO
public interface FollowDAO{
	
    @SQL("SELECT * FROM Follow WHERE userId=:1")
    List<Follow> queryById(int id);
    
    @SQL("INSERT INTO Follow ("
			        		+ "userId,"
			        		+ "objectUserId,"
			        		+ "createAt"
							+") VALUES ("
							+ ":t.userId,"
							+ ":t.objectUserId,"
							+ "now()"
					+")")
    void create(@SQLParam("t") Follow follow);
	
    @SQL("UPDATE Follow SET deleteFlag=0 WHERE id=:1")
    void deleteById(int id);
}